package com.witdata.common.mapper;

import com.witdata.common.domain.dto.ArticleDto;
import com.witdata.common.domain.dto.CommunityDto;
import com.witdata.mysql.domain.entity.TCommunity;
import com.witdata.mysql.domain.entity.TCommunityArticle;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface CommunityMapper {

    CommunityMapper INSTANCE = Mappers.getMapper(CommunityMapper.class);

    CommunityDto toCommunityDto(TCommunity community);

    List<CommunityDto> toCommunityDtoList(List<TCommunity> communityList);

    TCommunity toTCommunity(CommunityDto communityDto);

    List<TCommunity> toTCommunityList(List<CommunityDto> communityDtoList);

    List<ArticleDto> toArticleDtoList(List<TCommunityArticle> tCommunityArticleList);

    ArticleDto toArticleDto(TCommunityArticle tCommunityArticle);

    TCommunityArticle toTCommunityArticle(ArticleDto articleDto);

}
